package cn.aws360.boot.extend.open.api.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author junnan
 */
@Getter
@AllArgsConstructor
public enum ChatApiEnum {

    /**
     * AI
     */
    AI("AI", "https://api.openai.com/v1/completions"),

    /**
     * TL
     */
    TL("TL", "http://openapi.turingapi.com/openapi/api/v2"),

    ;

    private final String key;
    private final String url;

    public static ChatApiEnum getEnum(String key) {
        for (ChatApiEnum apiEnum : values()) {
            if (apiEnum.getKey().equalsIgnoreCase(key)) {
                return apiEnum;
            }
        }
        return null;
    }

}
